<include file="__THEME__/header" />
<link href="../Public/css/space.css" rel="stylesheet" type="text/css" />
<script>
//添加记录
function doadd(){
	var content = $.trim($("#record_contend").val());	
	if(content){
		if(content.length>140){
			$.tbox.no('{:L("record_content_too_more")}','{:L("wrong")}');
			return false;
		}else{
			$.post('{:U("home/Record/doadd")}',{content:content},function(result){
				if(result){
					$('#record_success').fadeTo(2000,1,function(){
					   $(this).hide();
					});					
					var html=result+'<span class="ml10 f12 cl06">{:L("just_now")}</span>';
					$('#record_show').html(html);
					$("#record_contend").val('');
					$("#record_input_count").html('{:L("can_input_character")}');
				}
			});
		}
	}else{
		$.tbox.no('{:L("record_content_no_empty")}','{:L("wrong")}');
	}
}
function delrecord(id){
	$.post('__URL__&act=delrecord',{id:id},function(result){
		$("#record_content_"+id).slideUp("normal",function(){
				$(this).remove();
		});
	});
}

$(document).ready(function(){
	$('#record_contend').focus(function(){
		$('#css_record_contend').attr('class','heart_b_01');
	});
	$('#record_contend').blur(function(){
		if($(this).val().length=='0'){
			$('#css_record_contend').attr('class','heart_b');
		}
	});	
	//解决统计字数闪屏问题
	$("#record_contend").keyup(function(event){
		if(event.keyCode==32)
			checkLength(this,'record_input_count',140);
	});
	$("#record_contend").keypress(function(event){
		checkLength(this,'record_input_count',140);
	});
	var shortcutOpt = {'target':'record_contend'};
	shortcut('ctrl+return',	function(){doadd();},shortcutOpt);	
}); 
	
//检查字数
function checkLength(o,tpoint,num){
	var lengthnum = $(o).val().length;
	var shownum;
	if(num>=lengthnum){
		shownum = num-lengthnum;
		$("#record_input_count").css('color','#999999');
		$("#record_input_count").html('{:L("can_input_info_1")}'+shownum+'{:L("can_input_info_2")}');
	}else{
		shownum = lengthnum - num;
		$("#record_input_count").css('color','red');
		$("#record_input_count").html('{:L("can_input_more_info_1")}'+shownum+'{:L("can_input_more_info_2")}');
        return false;
	}
}
</script>

<div class="contents lbg B">
<include file="../Public/home_left" />
  <div class="contents_min w787">
  	    <h3 class="tit_h3">{:L('nav_myrecord')}</h3>
      <div class="write_info w600">
	      <h4 class="cl06 lh18 mb10 fn f14">
	      <div id="record_show">
      	<php>if($record){</php> {$record.content} <php>}else{</php>{:L('do_nothing')}<php>}</php>
      	<span class="ml10 f12 cl06"><php>if($record){</php> {$record.cTime|friendlyDate} <php>}</php></span>
      </div>
	      </h4>
            <form action="__APP__&app=space&mod=record&act=addrecord" method="post" autocomplete="off">
           <div class="heart_box_02">
        <div class="catch"><span class="R cl06 pr10" id="record_input_count" style="*padding-bottom:7px; *margin-bottom:0">{:L('can_input_info_1')}140{:L('can_input_info_2')}</span><span class="heart_font">{:L('record_about')}</span></div>
        <div><div class="blest" id="record_success" style="display:none"></div><div class="heart_b" id="css_record_contend"><textarea name="textarea" id="record_contend" style="word-break:break-all;"></textarea></div></div>
        <div class="pr10"><span class="R mt10"><input type="button"  class="btn_mini ml10 mb5" value="{:L('add_new')}" onclick="doadd()"/></span><span class="heart_b_f"><a class="icon_app" href="{:U('home/blog/post')}">{:L('post_blog')}</a><a class="icon_hall" href="{:U('bbs/Index/post')}">{:L('post_thread')}</a><a class="icon_iss"href="{:U('ask/index/post')}">{:L('post_ask')}</a></span></div><div class="C"></div>
      </div>
       </form>
</div>

      
      <div class="tab">
        <!-- 切换标签 begin  -->
        <ul>
    
          <li <eq name='strtype' value='index'>class="on"</eq> ><span><a href="__URL__&act=index">{:L('nav_myrecord')}</a></span></li>
          <li <eq name='strtype' value='attention'>class="on"</eq> ><span><a href="__URL__&act=index&act=attention">{:L('nav_colleague_record')}</a></span></li>
          <li <eq name='strtype' value='all'>class="on"</eq> ><span><a href="__URL__&act=index&act=all">{:L('nav_other_record')}</a></span></li>

        </ul>
      </div>
      <div class="friendBox">
      <div class="sidebar_R">
        <dl class="FSort base_input">
        	<dt>{:L('list_show')}</dt>
			<php>$spage=($_GET['p'])?'&p='.$_GET['p']:''</php>
            <dd <eq name="d" value="">class="ic"</eq> ><a href="{:U('home/Record/'.ACTION_NAME)}{$spage}">{:L('list_all')}</a></dd>
            <dd <eq name="d" value="today">class="ic"</eq>  ><a href="{:U('home/Record/'.ACTION_NAME,'d=today')}{$spage}">{:L('list_onday')}</a></dd>
            <dd <eq name="d" value="weekday">class="ic"</eq>  ><a href="{:U('home/Record/'.ACTION_NAME,'d=weekday')}{$spage}">{:L('list_onweek')}</a></dd>
			<dd <eq name="d" value="month">class="ic"</eq>  ><a href="{:U('home/Record/'.ACTION_NAME,'d=month')}{$spage}">{:L('list_onemonth')}</a></dd>
        </dl>
      </div>
        <div class="FList">
        <volist id="vo" name="list">
          <div class="Fli" id="record_content_{$vo.id}">
            <div class="headpic50 L"><a href="{:U('space/View/index','uid='.$vo['uid'])}"><img src="{$vo.uid|getUserFace='s'}" /></a></div>
            <div class="LC">
              <div onmouseover="this.className='on'" onmouseout="this.className='#'">
              <php>if( $vo['uid']==$mid ){</php><a href="javascript:void(0)" onclick="delrecord({$vo.id})" class="delR">{:L("delete")}</a><php>}</php><a href="{:U('space/View/index','uid='.$vo['uid'])}" class="f12 mr10">{$vo.uid|getUserName}</a><em>{$vo.cTime|friendLydate}</em><br />
                {$vo.content}  <a href="javascript:void(0)" onclick="hide_reply(this,{$vo.id});" class="ml10">收起回复</a> </div>
				
               	<div id="reply_list_{$vo.id}" class="rc">
               		{$vo.comment}
				</div>
			  
            </div>
            <div class="C"></div>
          </div>
         </volist>
		      <div class="C"></div>
        <div class="page mt5 alR mb20"> {$page} </div>
      </div>
        </div>
      </div>
      <div class="C"></div>
    </div>
    <div class="C"></div>
  </div>
<include file="__THEME__/footer" /> 